﻿#include <iostream>
#include "binaryTree.h"
using namespace std;

int main(){
	binaryTree<int> t;
	Node<int>* n1 = new Node<int>(1, nullptr, nullptr);
	Node<int>* n2 = new Node<int>(2, nullptr, nullptr);
	Node<int>* n3 = new Node<int>(3, nullptr, nullptr);
	Node<int>* n4 = new Node<int>(4, nullptr, nullptr);
	Node<int>* n5 = new Node<int>(5, nullptr, nullptr);
	Node<int>* n6 = new Node<int>(6, nullptr, nullptr);
	Node<int>* n7 = new Node<int>(7, nullptr, nullptr);
	Node<int>* n8 = new Node<int>(8, nullptr, nullptr);
	Node<int>* n9 = new Node<int>(9, nullptr, nullptr);
	Node<int>* n10 = new Node<int>(10, nullptr, nullptr);
	Node<int>* n11 = new Node<int>(11, nullptr, nullptr);
	Node<int>* n12 = new Node<int>(12, nullptr, nullptr);
	n1->set(n2, n3);
	n2->set(n4, n5);
	n3->set(n6, n7);
	n4->set(n8, n9);
	n5->set(n10, nullptr);
	n6->set(n11, n12);
	t.setRoot(n1);
	
	
	int countofLeaves = 0;
	t.numofLeaves(t.getRoot(), countofLeaves);
	cout << countofLeaves << '\n';

	t.swapChild(t.getRoot());
	t.inOrderTraverse(t.getRoot());
	cout << '\n';

	t.leveledTraverse(t.getRoot());
	cout << '\n';

	cout << t.widthofBinaryTree(t.getRoot());
	return 0;
}

